#include <bits/stdc++.h>
using namespace std;
#define int long long
int gcd(int a,int b)
{
    return b==0?a:gcd(b,a%b);
}
void solve()
{
    int n,x;
    cin>>n;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        ans+=n/(x/gcd(x,i));
    }
    cout<<ans;
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}